<html>
	<head>
		<script src="../js/jquery.min.js"></script>
	</head>
	<body>
		<button class='btn'>生成图片</button>
		<div class='t1'><input type="text" /></div>
		<div class='t2'><input type="text" /></div>
		<div class='t3'><input type="text" /></div>
		<div class='t4'><input type="text" /></div>
		
		<img src="" alt=""  id='mianimg'/>
	</body>
	<script>
		$('.btn').click(function(){
			var _txt1 = $('.t1 input').val();
			var _txt2 = $('.t4 input').val();
			var _txt3 = $('.t3 input').val();
			var _txt4 = $('.t2 input').val();
			$.ajax({
				url:"../index.php?m=home&c=index&a=index",
				data:{'text1':_txt1,'text2':_txt2,'text3':_txt3,'text4':_txt4},
				type:'post',
				success:function(ret){
					if (ret.status){ //成功,输出图片路径
						$('#mianimg').attr('src','.'+ret.path)
					}else{
						//失败
						alert(ret.info)
					}
				}
			})
		})
	</script>
</html>

